package day8;

import java.util.Arrays;
import java.util.Random;

/**
 * @author oldliu
 * @since 1.0
 */
public class RandoMTest {
    public static void main(String[] args) {
        Random r=new Random();
        System.out.println("int");
        for(int i=1;i<=20;i++){
            System.out.print(r.nextInt()+"\t");
        }
        System.out.println();
        System.out.println("int 2");
        for(int i=1;i<=20;i++){
            System.out.print(r.nextInt(23)+"\t");
        }
        System.out.println();

        System.out.println("double");
        for(int i=1;i<=20;i++){
            System.out.print(r.nextDouble()+"\t");
        }
        System.out.println();
        System.out.println("double >0");
        for(int i=1;i<=20;i++){
            System.out.print(r.nextGaussian()+"\t");
        }
        System.out.println();
        System.out.println("boolean");
        for(int i=1;i<=20;i++){
            System.out.print(r.nextBoolean()+"\t");

        }
        System.out.println();
        System.out.println("byte 数组:");
        byte []b=new byte[30];
        for(int i=1;i<=20;i++){
            r.nextBytes(b);//进入后，改了
            System.out.println(Arrays.toString(b));
        }
        System.out.println();
    }
}
